package com.bingquan.company.mapstruct;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class TrafficResonse {
    public static void main(String[] args) {
//        String responseBody = "{\n" + "    \"res\": \"200\",\n" + "    \"msg\": \"添加短信模板成功！\",\n"
//            + "    \"respdata\": {\n" + "        \"records\": [\n" + "            {\n"
//            + "                \"codeDesc\": \"成功\",\n" + "                \"code\": \"0000\",\n"
//            + "                \"msgId\": \"0ea78d8c16b5489faddcb975d709b657\",\n"
//            + "                \"templateId\": \"10028395\"\n" + "            }\n" + "        ]\n" + "    },\n"
//            + "    \"success\": true\n" + "}\n";
//
//        JSONObject jsonObject = JSONObject.parseObject(responseBody);
//        System.out.println(jsonObject.getBoolean("success"));
//        System.out.println(jsonObject.getString("respdata"));
//
//        String respdata = jsonObject.getString("respdata");
//        JSONObject jsonObject1 = JSONObject.parseObject(respdata);
//        JSONArray records = jsonObject1.getJSONArray("records");
//
//        // JSONArray records = jsonObject.getJSONArray("records");
//        for (int i = 0; i < records.size(); i++) {
//            // 提取出family中的所有
//            JSONObject jsonObject2 = (JSONObject)records.get(i);
//            System.out.println("currentRecord:" + jsonObject2);
//            // JSONObject.parseObject(records.get(i));
//            System.out.println(jsonObject2.getString("msgId"));
//            System.out.println(jsonObject2.getString("codeDesc"));
//            System.out.println(jsonObject2.getString("templateId"));
//
//
//
//        }

        String aa = "10000104";
        String content = "15608653631";
        Map<String, Object> map = new HashMap<>();
        map.put("templateId", aa);
        map.put("content", content);

        String s = JSONObject.toJSONString(map);
        System.out.println(s);

    }
}
